function res = array_of_vals(vals_arr, err_arr, units)
if isscalar(err_arr)
    err_arr = ones(size(vals_arr))*err_arr;
end
if sum((size(vals_arr)~=size(err_arr)))
    error('err_arr should be scalar or the same size as vals_arr')
end
if (size(vals_arr,1)~=1)&&(size(vals_arr,2)~=1)
    error('curently only vectors are supported')
end
if size(vals_arr,1)>size(vals_arr,2)
    res = [];
    for i=1:size(vals_arr,1)
        res = [res;PhysicalVal(vals_arr(i),err_arr(i), units)];
    end
else
    res = [];
    for i=1:size(vals_arr,2)
        res = [res PhysicalVal(vals_arr(i),err_arr(i), units)];
    end
end

end